package com.jwmp.rbac.domain;

import java.util.List;

/**
 * @Description 角色模型，用于封装权限数据
 * @Version 1.0
 */
public class Permission {
    private Long        id;              // 唯一标识
    private String      name;            // 权限中文描述
    private String      expression;      // 权限表达式或路径
    private Module      module;          // 权限所属模块
    private List<Role>  roleList;        // 角色列表

    public Permission() {
    }

    public Permission(String name, String expression, Module module) {
        this.name = name;
        this.expression = expression;
        this.module = module;
    }

    public Permission(String name, String expression, Module module, List<Role> roleList) {
        this.name = name;
        this.expression = expression;
        this.module = module;
        this.roleList = roleList;
    }

    public Permission(Long id, String name, String expression, Module module, List<Role> roleList) {
        this.id = id;
        this.name = name;
        this.expression = expression;
        this.module = module;
        this.roleList = roleList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Module getModule() {
        return module;
    }

    public void setModule(Module module) {
        this.module = module;
    }

    public String getExpression() {
        return expression;
    }

    public List<Role> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }

    public void setExpression(String expression) {
        this.expression = expression;
    }

    public String toString() {
        return "Permission{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", expression='" + expression + '\'' +
                ", module=" + module +
                ", roleList=" + roleList +
                '}';
    }
}
